# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=mkmr
pkgver=0.0.26
pkgrel=0
pkgdesc="Make merge requests in any GitLab repo conveniently"
options="!check" # No testsuite
url="https://github.com/maxice8/mkmr"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	python3
	py3-setuptools
	py3-gitlab
	py3-gitpython
	py3-python-editor
	py3-inquirer
	py3-giturlparse
	"
makedepends="scdoc"
subpackages="$pkgname-doc"
source="https://files.pythonhosted.org/packages/source/m/mkmr/mkmr-$pkgver.tar.gz"

prepare() {
	default_prepare
	# Flit is dumb, use setuptools instead of distutilsc.core
	sed -i 's|distutils.core|setuptools|' setup.py
}

build() {
	python3 setup.py build

	for d in docs/*; do
		scdoc < $d > ${d%.scd}
	done
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
	mkdir -p "$pkgdir"/usr/share/man/man1
	mv docs/*.1 "$pkgdir"/usr/share/man/man1
}
sha512sums="63381108e89deb7692fbf4593a1568332a10442d1305b4518f39138f35a2aa4de112c9b3453f09e0cfdc63fd9a75a8879023f3342f7536c0c29529d8ce980434  mkmr-0.0.26.tar.gz"
